#ifndef BILL_H
#define BILL_H

#include <QWidget>
#include "networkmanager.h"
// 前向声明
class Widget;
class Log;
class Card;
namespace Ui {
class Bill;
}

class Bill : public QWidget
{
    Q_OBJECT

public:
    explicit Bill(QWidget *parent = nullptr);
    ~Bill();
    void setWidget(Widget *w);
    void setLog(Log *l);
    void setCard(Card *c);
    void setNetworkManager(NetworkManager *manager);

private slots:
    void on_pushButton_home_clicked();
    void on_pushButton_card_clicked();
    void on_pushButton_log_clicked();
public slots:
    void onDataReceived(const QByteArray &data); //处理接收到的数据
private:
    Ui::Bill *ui;
    Widget *widget;
    Log *log;
    Card *card;
    NetworkManager *networkManager; //网络通信管理

    //用于标记是否开始接收会员信息
    bool isReceivingMembershipInfo = false;
    QString membershipCsvData;
};

#endif // BILL_H
